#include <iostream>
using namespace std;

signed main()
{
    string s1,s2;
    getline(cin,s1);
    getline(cin,s2);
    int f[127] = {0};
    for(int i=0;i<s1.size();i++){
        if(f[s1[i]]==0){
            cout<<s1[i];
            f[s1[i]]=1;
        }
    }
    for(int i=0;i<s2.size();i++){
        if(f[s2[i]]==0){
            cout<<s2[i];
            f[s2[i]]=1;
        }
    }
    return 0;
}
